import request from '../request'
import { AxiosResponse } from 'axios'
import { LoginFrom } from '@/types/views/login'
import { ResponseData } from '@/types/api/public'
// import { LoginSuccess, UserInfo, RouterData } from '@/types/api/login'

type ConfigType<T=ResponseData> = Promise<AxiosResponse<T>>



/**
 * @desc: get请求
 */
 export const getjianli = ({page,page_size,inpu1,inpu2,inpu3,inpu4}): ConfigType => {
  return request({
    url: `/jianli?page=${page}&page_size=${page_size}&inpu1=${inpu1}&inpu2=${inpu2}&work_address=${inpu3}&desired=${inpu4}`,
    method: 'get'
  })
}

/**
 * @desc: post添加
 * @param { Object } data
 */
 export const addjianli = (data:LoginFrom): ConfigType => {
  return request({
    url: '/jianli',
    method: 'post',
    data:data._object.formState
  })
}

/**
 * @desc: delete 删除
 * @param { Object } data
 */
 export const deljianli = (id:any): ConfigType => {
  return request({
    url: '/jianli?id='+id,
    method: 'delete',
  })
}